﻿CXX      = $(shell fltk-config --cxx)
CXXFLAGS = $(shell fltk-config --cxxflags ) -I. -Isrc -Isrc/rtmidi-2.0.1
LDSTATIC = $(shell fltk-config --ldstaticflags )
_LD = `fltk-config --ldstaticflags` -lwinmm -lcomctl32 -O3 -Wall
LINK     = $(CXX)

#-lfltk -lcomctl32 -lwsock32 -lole32 -luuid -O3 -Wall -Wunused -Wno-format-y2k -fno-exceptions -fno-strict-aliasing -mwindows -mno-cygwin

TARGET = test/midi
OBJS = Fl_MIDIKeyboard.o MIDIDriver.o RtMidi.o test_Fl_MIDIKeyboard_hor.o
OBJS2 = Fl_MIDIKeyboard.o MIDIDriver.o RtMidi.o test_Fl_MIDIKeyboard_hor.o
SRCS = Fl_MIDIKeyboard.cpp MIDIDriver.cpp RtMidi.cpp test_Fl_MIDIKeyboard_hor.cpp \
       test_Fl_MIDIKeyboard_vert.cpp

.SUFFIXES: .o .cpp

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c -g $<

all: $(TARGET)
	$(LINK) -o $(TARGET) $(OBJS) $(_LD)

test/midi: $(OBJS) 
test/midi2:

Fl_MIDIKeyboard.o: 
	$(CXX) $(CXXFLAGS) -c -g src/Fl_MIDIKeyboard.cpp src/Fl_MIDIKeyboard.h

MIDIDriver.o:
	$(CXX) $(CXXFLAGS) -c -g src/MIDIDriver.cpp src/MIDIDriver.h

RtMidi.o:
	$(CXX) $(CXXFLAGS) -c -g src/rtmidi-2.0.1/RtMidi.cpp src/rtmidi-2.0.1/RtMidi.h

test_Fl_MIDIKeyboard_hor.o:
	$(CXX) $(CXXFLAGS) -c -g test/test_Fl_MIDIKeyboard_hor.cpp

test_Fl_MIDIKeyboard_vert.o:
	$(CXX) $(CXXFLAGS) -c -g test/test_Fl_MIDIKeyboard_vert.cpp


.PHONY: clean
clean:
	rm -f *.o $(TARGET)

